package net.chathu.airgw.packets.gw.clientpackets 
{
	import net.chathu.airgw.model.User;
	import net.chathu.airgw.packets.gw.serverpackets.IsonPacket;
	/**
	 * ...
	 * @author ze
	 */
	public class CMDIsOn extends IRCReceivablePacket 
	{
		
		public function CMDIsOn() 
		{
			
		}
		
		override public function execute():void {
			
			var reply:String = "";
			var user:User;
			for (var i:int = 1; i < data.length; i++)
			{
				user = User(sessionData.chatData.users.getUserByNameIgnoreCase(data[i]));
				if (user)
				{
					reply += user.name + " ";
				}
			}

			sendToClient(new IsonPacket(sessionData.nick, reply));
		}		
		
		public static function getShortUsageDescription():String {
			return "Online állapot ellnőrzés";
		}
		
		public static function getUsageDescription():String {
			return "Példa:\n" +
				"/ison gipsz_jakab,fül_elek\n\n" +
				"Eredmény:\n" + 
				"ISON gipsz_jakab";
		}
	}
}